#include <gui/dialpage_screen/DialPageView.hpp>
#include <gui/dialpage_screen/DialPagePresenter.hpp>
//
DialPagePresenter::DialPagePresenter(DialPageView& v)
    : view(v)
{

}
//
void DialPagePresenter::activate()
{
	DialPagePresenterState(true);
}
//
void DialPagePresenter::deactivate()
{
	DialPagePresenterState(false);
}
//DialPagePresenter
void DialPagePresenter::DialPagePresenterState(bool enable)
{
	if(enable == true)
		model->DialPageViewTask(true);
	else
		model->DialPageViewTask(false);
}
//更新时间
void DialPagePresenter::updateTime(uint8_t newHours, uint8_t newMinutes, uint8_t newSeconds)
{
    view.updateTime(newHours, newMinutes, newSeconds);
}
//更新日期
void DialPagePresenter::updateDate(uint8_t newYear, uint8_t newMonth, uint8_t newDate, uint8_t newWeekDay)
{
    view.updateDate(newYear, newMonth, newDate, newWeekDay);
}
//五向按键切换页面
void DialPagePresenter::DialPageChange(uint8_t newFiveKeyFunc)
{
	  view.DialPageChange(newFiveKeyFunc);
}
//进入运动模式界面
void DialPagePresenter::SportPageEnter(uint8_t newKeyFunc)
{
	  view.SportPageEnter(newKeyFunc);
}
//更新温度/步数/心率
void DialPagePresenter::updateTempStepHeart(float newTem, unsigned long newStep, uint32_t newHeartRate)
{
		view.updateTempStepHeart(newTem,newStep,newHeartRate);	
}